home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_11333.txt < prev    next >
Text File  |  1989-02-26  |  2KB  |  104 lines

  1. -- card: 11333 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3837
  5. -- name: MoveFile
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=82 top=302 right=324 bottom=182
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if the optionkey is down then
  23.     pass mouseup
  24.   end if
  25.  
  26.   put (long name of this stack) into sourceStack
  27.   delete first word of sourceStack
  28.   delete first character of sourceStack
  29.   delete last character of sourceStack
  30.   put "Select a stack to copy this resource into."
  31.   put filename("STAK") into fname
  32.   if fname is empty then
  33.     hide message window
  34.     exit mouseup
  35.   end if
  36.   if sourcestack=fname then
  37.     beep
  38.     Answer "Get real.  You can't install it in this stack"
  39.     hide message window
  40.     exit mouseup
  41.   end if
  42.  
  43.   --
  44.   ModResCopy sourceStack,fname,"XFCN","MoveFile"
  45.   --
  46.   get the result
  47.   if first char of it is "E" then
  48.     put it into the message box
  49.     beep
  50.     answer "Attempt to install resource has failed."
  51.   else
  52.     beep
  53.     answer "Resource installation successful"
  54.   end if
  55.   hide message window
  56. end mouseUp
  57.  
  58.  
  59.  
  60. -- part contents for background part 5
  61. ----- text -----
  62. MoveFile
  63.  
  64. -- part contents for background part 10
  65. ----- text -----
  66. 7
  67.  
  68. -- part contents for background part 6
  69. ----- text -----
  70.  
  71. This moves files between folders on the same volume
  72. (it can't be used to copy files between volumes). 
  73.  
  74.  
  75.  
  76.  
  77.  
  78. Thanks to:
  79. Dewi Williams
  80. 2227 Juniper Court
  81. Boulder CO 80302
  82. (303) 443 9038
  83. Delphi: DEWI
  84.  
  85.  
  86. -- part contents for background part 7
  87. ----- text -----
  88. Syntax:
  89.  
  90. put MoveFile ("OldName",
  91. "NewFolder") into result
  92.  
  93. "OldName" is a full pathname of the file that you want to rename.
  94.  
  95. "Newfolder" specifies the destination folder.
  96. Do not put quotation marks around 
  97. "OldName" and "NewName"
  98.  
  99. The result will contain either 
  100. 0 (meaning a successful operation),
  101. 1 (meaning a parameter error), or
  102. a negative number (representing an operating system error).
  103.  
  104. You can use the 'OsErr' function provided in the script of this stack to interpret operating system errors.